import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../../src/layout/index.vue' // 主框架路径
import refresh from '../views/refresh.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    component: Layout,
    redirect: '/home', //访问/重定向到/home


},
    {
        path: '/home',
        component: Layout,
        children: [
            {
                path: '/',
                component: () => import('../views/Dashboard.vue'),
                name: 'home',

            },
            {
                path: '/adminList',
                name: 'adminList',
                component: () => import('../views/admin_list.vue'),
            },
            {
                path: '/adminGroup',
                name: 'adminGroup',
                component: () => import('../views/admin_group.vue'),
            },
            {
                path: '/adminPermiss',
                name: 'adminPermiss',
                component: () => import('../views/admin_permiss.vue'),
            },
            {
                path: '/doctor',
                name: 'doctor',
                component: () => import('../views/doctor.vue'),
            },
            {
                path: '/patient',
                name: 'patient',
                component: () => import('../views/patient.vue'),
            },
            {
                path: '/doctorGroup',
                name: 'doctorGroup',
                component: () => import('../views/doctorGroup.vue'),
            }, {
                path: '/patientGroup',
                name: 'patientGroup',
                component: () => import('../views/patientGroup.vue'),
            }, {
                path: '/PunchinManger',
                name: 'PunchinManger',
                component: () => import('../views/PunchinManger.vue'),
            },

            // {
            //     path: '/Criteria_list',
            //     name: 'Criteria_list',
            //     component: () => import('../views/Criteria_list.vue'),
            // },

            // {
            //     path: '/log_list',
            //     name: 'log_list',
            //     component: () => import('../views/log_list.vue'),
            // },
        ]
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('../views/login.vue'),
    },
    {
        path: '/refresh',
        name: 'refresh',
        component: refresh
    },
]

const router = new VueRouter({
    routes,
    mode: 'hash'
})

export default router
